<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>ES5模块开发</title>
  <link rel="stylesheet" href="./index.css">
</head>
<body>
  <div class="tab J_tab">
    <div class="nav">
      <div class="nav-item current">选项1</div>
      <div class="nav-item">选项2</div>
      <div class="nav-item">选项3</div>
    </div>
    <div class="page">
      <div class="page-item current">页面1</div>
      <div class="page-item">页面2</div>
      <div class="page-item">页面3</div>
    </div>
  </div>
</body>
<script src="./index.js"></script>
<script>
  var tab = new Tab();
  tab.init();


  // mycall
  Function.prototype.myCall = function (o, ...arg1) {
    o.fn = this;
    o.fn(...arg1);
    delete o.fn;
  }

  function  fn(a, b, c) {
    // this.cons = "fn()";
    console.log(this.cons, a, b ,c);
  }

  var val = {
    cons: "Object val",
  }

  fn(1, 2, 3);
  fn.myCall(val, 1, 2, 3);
  console.log(val);
</script>
</html>